<?php 
/**
 * 加盟商model类
 * @Author    紫梦
 * @DateTime  2017-11-13
 * @copyright 响响租车
 * @version   1.0
 */
namespace app\common\model;
use think\Model;
use think\model\concern\SoftDelete;


class Agency extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;
    protected $insert = ['agency_id'];
    
    protected function setAgencyIdAttr()
    {
        return session('admin.agency_id');
    }

    public function cars()
    {
        return $this->hasMany('Cars','agency_id');
    }
}